<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  
<div id="app">
  <!-- 1.使用v-bind进行动态绑定，改变message value进行修改 -->
  <!-- <input type="text" :value="message"> -->

  <!-- 2.input内部响应事件, 进行双向绑定 -->
  <!-- <input type="text" :value="message" @input="valueChange"> -->

  <!-- 3. 直接获取网页元素event解析value值并重新赋值 -->
  <input type="text" :value="message" @input="message = $event.target.value">

  <h2>{{message}}</h2>
</div>

<script src="../js/vue.js"></script>
<script>
  const app = new Vue({
    el: '#app',
    data:
    {
      message: 'Hello World'
    },
    methods: 
    {
      valueChange (event)
      {
        console.log("触发input事件");
        this.message = event.target.value;
      }  
    }
  })  
</script>

</body>
</html>